package org.ben.birthday.twentybirthday.service;

import org.ben.birthday.twentybirthday.entity.User;
import org.ben.birthday.twentybirthday.utils.Result;

import javax.servlet.http.HttpSession;


/**
 * @Author: Ben
 * @Date: 2019/7/18 17:59
 */
public interface IUserService {

   /**
    * 注册IService
    * @param user
    * @param httpSession
    * @return boolean
    */
   boolean registService(User user,HttpSession httpSession);

   /**
    * 登录IService
    * @param userName
    * @param password
    * @param httpSession
    * @return Result
    */
   Result loginUserNameService(String userName, String password,HttpSession httpSession);

   /**
    *用户名邮箱登录IService
    * @param httpSession
    * @param userName
    * @param email
    * @param verificationCode
    * @return Result
    */
   Result loginEmailService(HttpSession httpSession,String userName,String email,String verificationCode);

    /**
     * 根据用户名和原密码修改密码IService
     * @param userName
     * @param usedPassword
     * @param updatePassword
     * @param email
     * @param httpSession
     * @param verificationCode
     * @return boolean
     */
    boolean updatePasswordService(String userName,String usedPassword,String updatePassword,String email,HttpSession httpSession,String verificationCode);

    /**
     * 根据用户名，密保问题，密保答案找回密码IService
     * @param userName
     * @param email
     * @param httpSession
     * @param verificationCode
     * @param encryptedProblem
     * @param encryptedAnswer
     * @return boolean
     */
    boolean findPasswordService(String userName,String email,HttpSession httpSession,String verificationCode,String encryptedProblem,String encryptedAnswer);
}
